<?php
/*
 * Created on Feb 11, 2005
 *
 */

require_once ($DOCUMENT_ROOT . '/includes/functions.php');

session_start ();

db_connect ();

if (is_admin ())
{
		do_header ('Remove Teacher', '');
		
		echo "<h1>Remove a Teacher</h1>";
		
		if ($submit)
		{
			echo "<p>form submitted</p><p>but nothing happened :(</p>";
		}
		else
		{
			echo "<form method='post' action='$PHP_SELF'>";
			echo "<select name='select'>";
			db_connect ();
			$query = 'SELECT lName, fName FROM ilist ORDER BY lName';
			$result = mysql_query($query) 
				or die('Query failed: ' . mysql_error());

			// Print all names into drop down menu
			while ($line = mysql_fetch_array($result))
			{
				echo "<option value='$line[id]'>" . $line[lName] . ", " . $line[fName] . "</option>";
			}

	// Free resultset
	mysql_free_result($result);

			echo "</select>";
			echo "<p><input type='submit' value='Remove' name='submit'></p></form>";

		}
}
else
{
	do_header ('Failure');
	echo "<p>Failure: You are not an administrator</p>";
}
do_footer ();
?>
